﻿@using CommonSite.Common
@{
    Layout = "~/Views/Shared/_LayoutFrame.cshtml";
}

@section style
{
    <link type="text/css" rel="stylesheet" href="/Content/css-1.css" />
}

<div>
    <a style="margin-left:2%;font-size:medium;" href="/Item" target="_self">返回</a>
    <hr />
</div>


<div class="tt-content">
    <div class="tt-title">
        <h3>@ViewBag.Flow.Name</h3>
    </div>
    <div class="tt-body">
        <form id="form1" method="post" enctype="multipart/form-data">
            @{ 
                Html.RenderPartial("~/Views/Shared/FormTemplate.cshtml"); 
            }
        </form>
    </div>
    <div class="tt-foot">
        <div>
            @Html.Raw(ViewBag.Flow.Description)
        </div>
        <div style="text-align:center;margin-top:5px;">
        信诚天下、开拓未来&nbsp;&nbsp;&nbsp;&nbsp;制作部门:行政及人力资源部门
        </div>
    </div>
</div>

<div id="tt-continue">
</div>

<script type="text/javascript">
    $.metadata.setType("attr", "validate");
    $("#form1").ligerForm({});
    var v = $("#form1").validate({
        debug: true,
        errorPlacement: function (lable, element) {
            if (element.hasClass("l-textarea")) {
                element.ligerTip({
                    content: lable.html(),
                    target: element[0],
                    distanceX: -200
                });
            }
            else if (element.hasClass("l-text-field")) {
                element.parent().ligerTip({ content: lable.html(), target: element[0] });
            }
            else {
                element.parent().find('.l-text-field:first').ligerTip(
                    {
                        content: lable.html(),
                        target: element[0],
                        distanceX: 20
                    });

                //lable.appendTo(element.parents("td:first").next("td"));
            }
        },
        submitHandler: function (form) {
            $("form .l-text-field,.l-textarea").ligerHideTip();
            form.submit();
        }
    });
</script>